package cn.fulong.smebj.admin.controller;

import cn.fulong.frame.config.Result;
import cn.fulong.smebj.admin.service.ContestService;
import cn.fulong.smebj.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api("报名信息")
@RestController
@RequestMapping("/contest")
public class ContestController {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Autowired
    private ContestService contestService;

    @ApiOperation("学生用户-竞赛报名")
    @PostMapping(value = "/addInformation")
    public Result<Object> addInformation(@RequestBody User user) {
        return contestService.addInformation(user);
    }

    @ApiOperation("学生用户-我的报名查看")
    @PostMapping(value = "/myInformation")
    public Result<Object> myInformation(Long id) {
        return contestService.myInformation(id);
    }

    @ApiOperation("教师用户-报名管理")
    @PostMapping(value = "/infoList")
    public Result<Object> infoList(Integer pageNo, Integer pageSize) {
        return contestService.infoList(pageNo,pageSize);
    }

}
